// 类
  class FirstFn {
    youName:string
    hello:string
    constructor(name:string){
        this.youName = name
        this.hello = this.setName()
    }
    setName(){
        return `你好,${this.youName}`
    }
}
let myName1 = new FirstFn('温蒂')
// FirstFn.prototype.age = 2
// myName1.setAge = function (){
//     return 1
// }
// console.log(myName1.setName())
//继承
class twoFn extends FirstFn{
    constructor(name:string){
        //执行父类的构造函数
        super(name)
    }
    bark(){
        console.log('我是继承的')
    }
    //重写父类方法 只影响自己 不影响父类
    // setName(){
    //     return 123213
    // }
}
let twoFn1 = new twoFn('123213')
console.log(twoFn1)  